<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			//原型对象
			//watch.prototype
			function watch (){
				this.name = '劳力士',
				this.msg = function () {
					console.log(this);
				}
			}
			
			var w = new watch();
//			console.log(w);
//			在prototype上直接写的方法不用使用构造器			
			Array.prototype.alert = function () {
				alert(123);
			}
			
			var arr = [1];
			arr.alert();
		</script>
	</body>
</html>
